<include file="Public:header" />

<script type="text/javascript">
	$(document).ready(function(){
		$(".collect").click(function(){
			var nums=0;
			var id=$(this).attr('id');
			$("#nums").text(nums);
			$("#tips").hide();
			$("#load_"+id).show();
			$(this).hide();
		    	$.post("{:u('ArticleCollect/collect')}", { id:id }, function(data){
				    if(data.data){
				    	nums =nums+data.data;
					}
					$("#nums").text(nums);
					$("#tips").show();
					$("#load_"+id).hide();
				    $("#"+id).show();
				},"json");
		   	return false;
		})
	});	
</script>

</head>
<body>
<div class="pad-10" >

    <form id="myform" name="myform" action="{:u('ArticleCollect/delete')}" method="post">
    <div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width="5%">序号</th>
                <th width="1%"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
                <th width=60 align="left">节点名称</th>
                <th width=60>创建日期</th>
                <th width=60>最后采集日期</th>
                <th width=30>编码</th>
                <th width=30>排序值</th>
                <th width=30>操作</th>
            </tr>
        </thead>
    	<tbody>
        <volist name="list" id="val" >
        <tr>
        	<td align="center">{$val.key}</td>
            <td align="center"><input type="checkbox" value="{$val.id}" name="id[]"></td>
            <td align="left">{$val.name}</td>
            <td align="center">{$val.add_time|date="Y-m-d H:i:s",###}</td>
            <td align="center">{$val.last_time|date="Y-m-d H:i:s",###}</td>
            <td align="center">{$val.char_code}</td>
            <td align="center"><input type="text" class="input-text-c input-text" value="{$val.ord}" size="4" name="orders[{$val.id}]" /></td>
            <td align="center"><a class="blue" href="{:u('ArticleCollect/edit',array('id'=>$val['id']))}">编辑</a>|<a class="blue collect" id="{$val['id']}" href="{:u('ArticleCollect/collect',array('id'=>$val['id']))}">采集</a><img id="load_{$val['id']}" style="display:none;" src="__PUBLIC__/statics/images/ajax_loading.gif"/></td>
        </tr>
        </volist>
    	</tbody>
    </table>

    <div class="btn">
    	<label for="check_box" style="float:left;">全选/取消</label>
    	<input type="submit" class="button" name="submit" value="删除" style="float:left;margin:0 10px 0 10px;" onclick="return check();"/>
    	<input type="submit" class="button" name="order" onclick="document.myform.action='{:U('ArticleCollect/order')}'" value="排序" style="float:left;margin:0 10px 0 0px;"/>
    	<span id="loading" style="display:none;">正在采集，请稍后！<img src="__PUBLIC__/statics/images/ajax_loading.gif"/></span>
        <span id="tips" style="display:none;">共 <b id="nums" style="color:red;">0</b> 篇文章添加到数据库！</span>
    	<div id="pages">{$page}</div>
    </div>

    </div>
    </form>
</div>
</body>
</html>
